import uiautomator2 as u2

d = u2.connect_usb("4bf05af7")
# with open("phone.file", 'w', encoding='utf-8') as f:
#     # 通过这个方法来获取到控件的源代码文件
#     f.write(d.dump_hierarchy())
d.xpath('//*[@text="蓝牙"]').click()
